home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9755 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  943 b 

  1. Path: symiserver2.symantec.com!usenet
  2. From: Walter Bright <wbright@symantec.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Qsort & class - HELP
  5. Date: Sat, 02 Mar 1996 22:15:08 -0800
  6. Organization: Symantec Development Tools Business Unit
  7. Message-ID: <313938EC.3648@symantec.com>
  8. References: <1996Mar2.145458.4120@news.huji.ac.il>
  9. NNTP-Posting-Host: 155.64.77.55
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (WinNT; I)
  14.  
  15. shalitin wrote:
  16.  
  17. < I am trying to qsort() array of pointers to classes, and I don't succeed.
  18. < I have no idea why this is happenning, but I  think the sourse of the problem 
  19. is in
  20. < the CompareNames() function.
  21. <      friend int   CompareNames( const void *name1, const void *name2 )
  22. <      {
  23. <        return  stricmp( ((Names*)name1)->Name, ((Names*)name2)->Name  );
  24. <      }
  25.  
  26. I think your problem is that the parameter is actually a Names**, not a Names*.
  27.